import time
from selenium.webdriver.common.by import By
from Page import Page

class Page1(Page):
    # 1.点击添加按钮
    add_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div/div[2]/div/div/button[2]/span')
    def add_sale(self):
        self.click(self.add_loc)
    # 2.输入客户id
    userid_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div[1]/div/div[1]/div/input')
    def userid(self):
        self.send_keys(self.userid_loc, 1)
    # 3.输入产品id
    productid_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div[2]/div/div[1]/div/input')
    def productid(self):
        self.send_keys(self.productid_loc,1)
    # 4.点击销售状态框
    statusK_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[3]/div/div/div/div[1]/div[2]')
    def statusK(self):
        self.click(self.statusK_loc)
    # 5.点击选择状态
    status_loc=(By.XPATH,'/html/body/div[2]/div/div/div/div[1]/ul/li[4]/span')
    def status(self):
        self.click(self.status_loc)
    # 6.输入预期收益
    shouyi_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[4]/div/div[1]/div/input')
    def shouyi(self):
        self.send_keys(self.shouyi_loc,33)
    # 7.点击提交按钮
    com_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[5]/div/button[1]')
    def commit(self):
        self.click(self.com_loc)


